import request from '~/utils/request'

export function fetchCategory() {
  return request({
    url: '/category',
    method: 'get',
    query: {offse: 0, limit: 10},
  })
}

export function addCategory(category) {
  return request({
    url: '/category',
    method: 'post',
    params: category,
  })
}

export function updateCategory(id, category) {
  return request({
    url: `/category/${id}`,
    method: 'put',
    params: category,
  })
}

export function delCategory(id) {
  return request({
    url: `/category/${id}`,
    method: 'delete',
  })
}
